function formatterNumber(num) {
  if (num < 1000) return num;
  if (num >= 1000 && num < 10000) return (num / 1000).toFixed(2) + "K";
  return (num / 10000).toFixed(2) + "W";
}
function formatterDate(date) {
  if (date === null) return "";
  const newDate = new Date(date);
  const dateArr = [
    newDate.getFullYear(),
    newDate.getMonth() + 1,
    newDate.getDate(),
    newDate.getHours(),
    newDate.getMinutes(),
    newDate.getSeconds()
  ];
  for (let i = 0; i < dateArr.length; i++) {
    const val = dateArr[i];
    dateArr[i] = val < 10 ? "0" + val : val;
  }
  return `${dateArr[0]}-${dateArr[1]}-${dateArr[2]} ${dateArr[3]}:${dateArr[4]}:${dateArr[5]}`;
}
export default {
  formatterDate,
  formatterNumber
};
